/**
 * @module navigator页面操作
 */
import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import { NavigationParams } from 'react-navigation';

/**
 * @param fd: IFeidaoAiMobile;	// 系统参数
 * @param options: {
 *
 * routeName: string; // 页面名
 *
 * params?: NavigationParams; //同下
 *
 * key?: string; // 设置页面的key(一般情况跟页面名一致)
 *
 * };
 * @see [api](https://dfeidao.gitee.io/atom-nodejs/modules/navigator____.html)
 * @example
 * ```ts
 * import navigate_set_key from '@dfeidao/atom-mobile/navigator/navigate-set-key';
 * navigate_set_key({ routeName: 'home', key: 'login', params: { id: '', name: '' } }); // 带参数
 * navigate_set_key({ routeName: 'home', key: 'login' }); // 不带参数
 * ```
 */

export default function navigate_set_key(fd: IFeidaoAiMobile, options: {
	routeName: string;
	key: string;
	params?: NavigationParams;
}) {
	fd.page.props.navigation.navigate(options);
}
